﻿namespace NetFx.MSIL
{
  using System;
  using System.Text;
  using System.Collections;

  using System.Reflection;
  using System.Reflection.Emit;
  using System.Runtime.InteropServices;

  using System.Diagnostics;
  using System.Diagnostics.CodeAnalysis;
  using System.Diagnostics.SymbolStore;

  public abstract class MemberGenerator:AnyGenerator
  {
    #region Fields
    protected MemberInfo builder = null;
    #endregion
    #region Properties
    public override object AnyBuilder
    {
      get { return this.builder; }
    }
    public virtual string Name
    {
      get
      {
        return this.builder.Name;
      }
    }
    public virtual Module Module
    {
      get
      {
        return this.builder.Module;
      }
    }
    public virtual Type DeclaringType
    {
      get
      {
        return this.builder.DeclaringType;
      }
    }
    public virtual Type ReflectType
    {
      get
      {
        return this.builder.ReflectedType;
      }
    }
    public virtual MemberTypes MemberType
    {
      get
      {
        return this.builder.MemberType;
      }
    }
    public virtual int MetadataToken 
    {
      get
      {
        return this.builder.MetadataToken;
      }
    }
    #endregion
    #region Constructors
    public MemberGenerator(MemberInfo builder)
    {
      if (builder == null) throw new ArgumentNullException("builder can not be null!");
      this.builder = builder;
    }
    #endregion
    #region Methods
    #endregion
    #region Utils
    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
        this.builder = null;
      }
      base.Dispose(disposing);
    }
    #endregion
  }
}
